<?php
$Series = array();
$Nemos = array();
$Escala = array();
//GENERACION DE DATOS GRAFICA
//1. Extraemos nemos de url
  $i=0;
  $j=0;
  $Datos = $_GET["Datos"];
  $MDatos = explode(";",$Datos);
//  print_r($MDatos);
  foreach ($MDatos as $key=> $value) {
    if ($j ==1){$Series[$i] = $value;}
    if ($j ==0){$Nemos[$i] = $value;}
    if ($j ==2){$Escala[$i] = $value;}

    $j++;
    
    If($j> 2){$j=0;$i++;}
  }
//echo "<br>";
//print_r($Series);
//print "<br>";
//print_r($Nemos);

echo    "<chart>";
echo        " <chart_data>";   
echo              "<row>";
echo                 "<null/>";
echo                 "<string>1</string>";
echo              "</row>";

        //Preparamos para pasar por GET los Nemos
        $GetUrl="MyData.php?count=0";
        foreach ($Nemos as $nombre => $valor){
            $GetUrl .= "&".$valor."=". $Escala[$nombre];
        }

        //echo $GetUrl."<br>";
        foreach($Series as $nombre => $valor){
            echo "<row>";
            echo " <string>".$valor."</string>";
            echo "<number>10</number>";
            echo "</row>";
        }

echo    "</chart_data>";
?>
	<chart_grid_h alpha='10' thickness='1' type='solid' />
	<chart_grid_v alpha='10' thickness='1' type='solid' />
	<chart_guide horizontal='true' thickness='1' color='ffffff' alpha='50' type='dashed' radius='5' line_color='FFFF00' line_alpha='75' line_thickness='2' text_color='FFFF00' text_h_alpha='90' />	
	<chart_note type='bullet' size='11' color='AAAAFF' alpha='90' x='0' y='-125' offset_y='5' background_color_1='8888FF' background_alpha='65' shadow='low' />
	<chart_pref line_thickness='2' point_shape='none' fill_shape='false' />
	<legend shadow='low' transition='dissolve' delay='2' duration='0.5' x='205' y='5' width='800' height='5' layout='horizontal' margin='5' bullet='line' size='10' color='ffffff' alpha='75' fill_color='000000' fill_alpha='10' line_color='000000' line_alpha='0' line_thickness='0' />





<?php
echo   "<chart_type>Line</chart_type>";
echo   "<axis_category size='5' color='58FA58' /> ";
echo   "<axis_value  min='8' size='10'  color='58FA58' />";
echo  "<context_menu print='true' full_screen='true' save_as_jpeg='true' />" ; 
echo   "<update url='".$GetUrl."' delay='1' mode='stream_category' span='600' /> ";
echo   "<series_color>";
echo   "<color>0000FF</color>";
echo   "<color>FF0000</color>";
echo   "<color>01DF01</color>";
echo   "</series_color>";
echo   "</chart>";
?>
